package ro.bluecube.admlocal.registruagricol.entity;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import ro.bluecube.admlocal.commons.PersistableEntity;

@Entity
@NamedQueries( {
		@NamedQuery(name = "findAllVolum", query = "SELECT V FROM Volum V"),
		@NamedQuery(name = "findByNumar", query = "SELECT V FROM Volum V where V.nr = ?1"),
		@NamedQuery(name = "findVolumById", query = "SELECT V FROM Volum V where V.id = ?1") })
@Table(name = "volume")
public class Volum extends PersistableEntity{

	private static final long serialVersionUID = 1L;
	
	private String nr;

	public void setNr(String nr) {
		this.nr = nr;
	}

	public String getNr() {
		return nr;
	}
	
	public void setTitulari(Set<Titular> titulari) {
		this.titulari = titulari;
	}

	@OneToMany(mappedBy="id")
	public Set<Titular> getTitulari() {
		return titulari;
	}

	private Set<Titular> titulari;
}
